package com.chinasoft.workmanage.login.dao.impl;

import com.chinasoft.workmanage.login.dao.UserMapper;
import com.chinasoft.workmanage.login.model.User;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by Administrator on 2017/3/30.
 */
@Repository
public class UserMpaaerImpl implements UserMapper{
    @Autowired(required = true)
    protected SqlSession sqlSessionTemplate;

    @Override
    public boolean login(User user) {
        List<Object> objects = this.sqlSessionTemplate.selectList(User.class.getName() + ".login", user);
        if(null != objects && objects.size()==1)
            return true;
        return false;
    }
}
